package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiSrtpRouteGraphMapper;
import com.ruoyi.net.domain.BusiSrtpRouteGraph;
import com.ruoyi.net.service.IBusiSrtpRouteGraphService;

/**
 * srtp业务路由图Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class BusiSrtpRouteGraphServiceImpl implements IBusiSrtpRouteGraphService 
{
    @Autowired
    private BusiSrtpRouteGraphMapper busiSrtpRouteGraphMapper;

    /**
     * 查询srtp业务路由图
     * 
     * @param id srtp业务路由图主键
     * @return srtp业务路由图
     */
    @Override
    public BusiSrtpRouteGraph selectBusiSrtpRouteGraphById(String id)
    {
        return busiSrtpRouteGraphMapper.selectBusiSrtpRouteGraphById(id);
    }

    /**
     * 查询srtp业务路由图列表
     * 
     * @param busiSrtpRouteGraph srtp业务路由图
     * @return srtp业务路由图
     */
    @Override
    public List<BusiSrtpRouteGraph> selectBusiSrtpRouteGraphList(BusiSrtpRouteGraph busiSrtpRouteGraph)
    {
        return busiSrtpRouteGraphMapper.selectBusiSrtpRouteGraphList(busiSrtpRouteGraph);
    }

    /**
     * 新增srtp业务路由图
     * 
     * @param busiSrtpRouteGraph srtp业务路由图
     * @return 结果
     */
    @Override
    public int insertBusiSrtpRouteGraph(BusiSrtpRouteGraph busiSrtpRouteGraph)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiSrtpRouteGraph.getId())) {
            busiSrtpRouteGraph.setId(uuid);
        }
        busiSrtpRouteGraph.setCreateBy(SecurityUtils.getUsername());
        busiSrtpRouteGraph.setCreateTime(DateUtils.getNowDate());
        busiSrtpRouteGraph.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteGraph.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteGraphMapper.insertBusiSrtpRouteGraph(busiSrtpRouteGraph);
    }

    /**
     * 修改srtp业务路由图
     * 
     * @param busiSrtpRouteGraph srtp业务路由图
     * @return 结果
     */
    @Override
    public int updateBusiSrtpRouteGraph(BusiSrtpRouteGraph busiSrtpRouteGraph)
    {
        busiSrtpRouteGraph.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteGraph.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteGraphMapper.updateBusiSrtpRouteGraph(busiSrtpRouteGraph);
    }

    /**
     * 批量删除srtp业务路由图
     * 
     * @param ids 需要删除的srtp业务路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteGraphByIds(String[] ids)
    {
        return busiSrtpRouteGraphMapper.deleteBusiSrtpRouteGraphByIds(ids);
    }

    /**
     * 删除srtp业务路由图信息
     * 
     * @param id srtp业务路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteGraphById(String id)
    {
        return busiSrtpRouteGraphMapper.deleteBusiSrtpRouteGraphById(id);
    }
}
